package v1

import "time"

//BookAdminLogin 登录部分结构体

type BookAdminLoginRequest struct {
	UserName string `json:"userName" binding:"required" example:"admin"`
	Password string `json:"password" binding:"required" example:"123456"`
}

type BookAdminLoginResponseData struct {
	AccessToken string `json:"accessToken"`
}
type BookAdminLoginResponse struct {
	Response
	Data BookAdminLoginResponseData `json:"data"`
}

//管理员信息

type BookAdminInfoRequest struct {
	//query类型,使用form标签
	Id string `form:"id" binding:"required"`
}
type BookAdminInfoResponseData struct {
	BookAdminId   int       `json:"bookAdminId"`
	Username      string    `json:"username"`
	Password      string    `json:"password"`
	BookAdminName string    `json:"bookAdminName"`
	Status        int       `json:"status"`
	Email         string    `json:"email"`
	CreateTime    time.Time `json:"createTime"`
	UpdateTime    time.Time `json:"updateTime"`
}
type BookAdminInfoResponse struct {
	Response
}

//借阅图书结构体

type BookBorrowRequest struct {
	CardNumber int64  `json:"cardNumber" binding:"required" example:"123456789"`
	BookNumber int64  `json:"bookNumber" binding:"required" example:"123456789"`
	BorrowDate string `json:"borrowDate" binding:"required" example:"2023-04-01"`
}

type BookBorrowResponse struct {
	Response
}

//归还图书

type BookReturnRequest struct {
	BookNumber       int64  `form:"bookNumber"`
	ReturnDate       string `form:"returnDate"`
	ViolationMessage string `form:"violationMessage"`
	CardNumber       int64  `form:"cardNumber"`
}
type BookReturnResponse struct {
	Response
}

//借书报表

type BorrowReportRequest struct {
	PageNum   int    `form:"pageNum"`
	Size      int    `form:"size"`
	Condition string `form:"condition"`
	Query     string `form:"query"`
}

type BorrowReportResponseData struct {
	ViolationId      int64     `json:"violationId"`
	CardNumber       int64     `json:"cardNumber"`
	BookNumber       int64     `json:"bookNumber"`
	BorrowDate       time.Time `json:"borrowDate"`
	CloseDate        time.Time `json:"closeDate"`
	ReturnDate       time.Time `json:"returnDate"`
	ViolationMessage string    `json:"violationMessage"`
	ViolationAdminId int64     `json:"violationAdminId"`
	CreateTime       time.Time `json:"createTime"`
	UpdateTime       time.Time `json:"updateTime"`
	ViolationAdmin   string    `json:"violationAdmin"`
	ExpireDays       int64     `json:"expireDays"`
}
type BorrowReportResponseTotalData struct {
	Records []BorrowReportResponseData `json:"records"`
	Total   int64                      `json:"total"`
	Size    int64                      `json:"size"`
	Current int64                      `json:"current"`
	Pages   int64                      `json:"pages"`
}
type BorrowReportResponse struct {
	Response
}

// ReturnReportRequest 还书报表
type ReturnReportRequest struct {
	PageNum   int    `form:"pageNum" `
	Size      int    `form:"size" `
	Condition string `form:"condition" `
	Query     string `form:"query"`
}
type ReturnReportResponseData struct {
	BorrowId   int         `json:"borrowId"`
	CardNumber int64       `json:"cardNumber"`
	BookNumber int         `json:"bookNumber"`
	BorrowDate time.Time   `json:"borrowDate"`
	CloseDate  time.Time   `json:"closeDate"`
	ReturnDate interface{} `json:"returnDate"`
	CreateTime time.Time   `json:"createTime"`
	UpdateTime time.Time   `json:"updateTime"`
}
type ReturnReportResponseTotalData struct {
	Records []ReturnReportResponseData `json:"records"`
	Total   int64                      `json:"total"`
	Size    int64                      `json:"size"`
	Current int64                      `json:"current"`
	Pages   int64                      `json:"pages"`
}
type ReturnReportResponse struct {
	Response
}

// GetBookMessageRequest 获取公告信息
type GetBookMessageRequest struct {
	PageNum  int `form:"pageNum"`
	PageSize int `form:"pageSize"`
}

// GetBookMessageResponseData 公告响应信息
type GetBookMessageResponseData struct {
	NoticeId      int       `json:"noticeId"`
	NoticeTitle   string    `json:"noticeTitle"`
	NoticeContent string    `json:"noticeContent"`
	NoticeAdminId int       `json:"noticeAdminId"`
	CreateTime    time.Time `json:"createTime"`
	UpdateTime    time.Time `json:"updateTime"`
}

type GetBookMessageResponseTotalData struct {
	Records []GetBookMessageResponseData `json:"records"`
	Total   int64                        `json:"total"`
	Size    int64                        `json:"size"`
	Current int64                        `json:"current"`
	Pages   int64                        `json:"pages"`
}
type GetBookMessageResponse struct {
	Response
}

// NoticeRequest 添加新公告
type NoticeRequest struct {
	NoticeTitle   string `json:"noticeTitle" binding:"required" example:"2023-04-01"`
	NoticeContent string `json:"noticeContent" binding:"required" example:"2023-04-01"`
	BookAdminId   int64  `json:"bookAdminId" binding:"required" example:"123456789"`
}
type NoticeResponse struct {
	Response
}

// DeleteNoticeRequest 删除公告
type DeleteNoticeRequest struct {
	NoticeId int64 `json:"noticeId" binding:"required" example:"123456789"`
}

// DeleteNoticeResponse 响应
type DeleteNoticeResponse struct {
	Response
}

// GetNoticeRequest 获取指定id 的公告
type GetNoticeRequest struct {
	NoticeId int64 `form:"noticeId"`
}

// GetNoticeResponse 响应
type GetNoticeResponse struct {
	Response
}

// UpdateNoticeRequest 修改发布的公告
type UpdateNoticeRequest struct {
	NoticeId      int64  `json:"noticeId" binding:"required" example:"123456789"`
	NoticeTitle   string `json:"noticeTitle" binding:"required" example:"2023-04-01"`
	NoticeContent string `json:"noticeContent" binding:"required" example:"2023-04-01"`
}

// UpdateNoticeResponse 响应
type UpdateNoticeResponse struct {
	Response
}
